package com.jumi.microservice.material.dto;

import com.jumi.microservice.common.base.AbstractObject;
import com.jumi.microservice.common.exception.ExceptionEnum;
import com.jumi.microservice.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.util.List;

/**
 * 商品类(请求类)
 * @author ssk
 * @create 2020/8/4 14:55
 **/
public class JmGoodsRequest extends AbstractObject implements Serializable {
    private static final long serialVersionUID = 6673865974105807656L;

    @ApiModelProperty(value = "商品ID")
    @NotNull(groups = {UpdateGroup.class})
    private Long goodsId;

    @ApiModelProperty(value = "商品编码")
    private String goodsCode;

    @ApiModelProperty(value = "商品名称")
    private String goodsName;

    @ApiModelProperty(value = "商品拆合单分类")
    private Long cateId;

    @ApiModelProperty(value = "商品售卖类型")
    private Integer goodsType;

    @ApiModelProperty(value = "供应商ID")
    private Long supplierId;

    @ApiModelProperty(value = "供应商联系人名称")
    private String supplierName;

    @ApiModelProperty(value = "供应商厂家名称")
    private String supplierCompanyName;

    @ApiModelProperty(value = "最小单位ID")
    private Long unitId;

    @ApiModelProperty(value = "保质期")
    private Integer expire;

    @ApiModelProperty(value = "商品状态")
    private Integer status;

    @ApiModelProperty(value = "物料详情")
    private List<JmMaterialRequest> materials;

    private String createBy;

    private String updateBy;

    private List<Long> supplierIds;

    @ApiModelProperty(value = "仓库Id")
    private Long warehouseId;

    /**
     * 查询开始时间
     */
    @ApiModelProperty(value = "查询起始时间")
    private String startTime;

    /**
     * 查询结束时间
     */
    @ApiModelProperty(value = "查询截止时间")
    private String endTime;

    /**
     * 税务id
     */
    private int taxId;

    public int getTaxId()
    {
        return taxId;
    }

    public void setTaxId(int taxId)
    {
        this.taxId = taxId;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsCode() {
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Long getCateId() {
        return cateId;
    }

    public void setCateId(Long cateId) {
        this.cateId = cateId;
    }

    public Integer getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(Integer goodsType) {
        this.goodsType = goodsType;
    }

    public Long getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public Long getUnitId() {
        return unitId;
    }

    public void setUnitId(Long unitId) {
        this.unitId = unitId;
    }

    public Integer getExpire() {
        return expire;
    }

    public void setExpire(Integer expire) {
        this.expire = expire;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public List getMaterials() {
        return materials;
    }

    public void setMaterials(List<JmMaterialRequest> materials) {
        this.materials = materials;
    }



    public String getCreateBy() {
        return createBy;
    }

    public void setCreateBy(String createBy) {
        this.createBy = createBy;
    }

    public String getUpdateBy() {
        return updateBy;
    }

    public void setUpdateBy(String updateBy) {
        this.updateBy = updateBy;
    }

    public String getSupplierCompanyName() {
        return supplierCompanyName;
    }

    public void setSupplierCompanyName(String supplierCompanyName) {
        this.supplierCompanyName = supplierCompanyName;
    }

    public List<Long> getSupplierIds() {
        return supplierIds;
    }

    public void setSupplierIds(List<Long> supplierIds) {
        this.supplierIds = supplierIds;
    }

    public Long getWarehouseId() {
        return warehouseId;
    }

    public void setWarehouseId(Long warehouseId) {
        this.warehouseId = warehouseId;
    }

    @Override
    public <T> T clone(T target){
        try {
            return super.clone(target);
        } catch (Exception e) {
            throw ExceptionEnum.FAIL_CHANGE.newException();
        }
    }
}
